import { obj } from 'through2';

import { compatibleSVGVariables } from '../utils/compatible.utils';

function compatibleSVGVariablesTransform() {
    const stream = obj((chunk, encoding, callback) => {
        const compatibleResult = compatibleSVGVariables(String(chunk));
        callback(null, Buffer.from(compatibleResult, encoding));
    });

    return stream;
}

export { compatibleSVGVariablesTransform };
